use fltk::{app, enums::FrameType, frame::Frame, prelude::*, window::Window};
use clap::{Parser};

mod config;

// Arguments
#[derive(Parser)]
#[command(version, about, long_about)]
struct Arg {
    /// Config path
    #[arg(short, long, value_name = "FILE")]
    config: String,
}


fn main() {
    let args = Arg::parse();

    let config = config::parse_config(&args.config);
    let app = app::App::default();
    let mut wind = Window::new(100, 100, 400, 300, config["title"].as_str().unwrap());

    let mut frame = Frame::default().with_size(360, 260).center_of(&wind);
    frame.set_frame(FrameType::NoBox);
    frame.set_label(config["text"].as_str().unwrap());

    wind.make_resizable(true);
    wind.end();
    wind.show();

    app.run().unwrap();
}
